extend personLeft.pug

block append pageStyle
	link(href='${relativePath}/static/css/personCenter/personData.css' type="text/css" rel="stylesheet")
	link(href='${relativePath}/static/css/personCenter/application.css' type="text/css" rel="stylesheet")
	link(href='${relativePath}/static/css/personCenter/personIndex.css' type="text/css" rel="stylesheet")
	link(href="${relativePath}/static/css/shopping/foundation.min.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/shopping/foundation-datepicker.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/personCenter/account.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/shopping/rightOrder.css" rel="stylesheet" type="text/css")
	link(href='${relativePath}/static/css/personCenter/myShop.css' type="text/css" rel="stylesheet")

block personRight
	div.rightContent.fl
		div.content
			div.ptitle 我的店铺
			div.allcontent
				//- 切换内容
				div.tab-content
					div.detail-box.oneBox
						div.allcontent.allcontent2
							//- 个人相册详情
							include myshops/myPhotosdetail.pug

block append pageScript
	script(type="text/javascript" src="${relativePath}/static/js/jquery.validate.min.js")
	script(type="text/javascript" src="${relativePath}/static/js/messages_zh.js")
	script(type="text/javascript" src="${relativePath}/static/js/card.js")

	script.
		
		$(function(){
			//- 当前选中
			$("#myShop").addClass("current").siblings("li").removeClass("current");
			$(".ywc").removeClass("current");	
			$(".realRZ").removeClass("current");
			$(".allcontent2").show()
			//- 上传荣誉资质照片
			//- 点击上传图片
			$(".upImgbtns .up").click(function() {
				$(".haddImgsMask").show()
			})
			//- 点击关闭遮罩层
			$(".htopSelct i").click(function() {
				$(".haddImgsMask").hide()
			})
			//- 图片上传
			$("input#horderImg").on("change", function() {
				var wrap = $(this).closest(".hupimg-div");
				doUpload_img(this.files[0], function(data) {
					var imgUrl = $("input[name='horder_img']").val();
					if(imgUrl) {
						$("input[name='horder_img']").val(imgUrl + "," + data.data.path);
					} else {
						$("input[name='horder_img']").val(data.data.path);
					}
					wrap.prepend("<span class='imgwarp'><img src='"+data.data.url+"' path='"+data.data.path+"' class='upimgs'></img><i></i></span>");
					if($("span.imgwarp img.upimgs").length > 7) {
						$("#horderImg").hide();
						$(".hadd-img").hide();
					}
					
				});
			});
			//- 上传图片
			function doUpload_img(file, callback) {
				var formdata=new FormData($("#huploadForm")[0])
				//console.log(formdata);
				$.ajax({
					url:shopIp+"/Utils/uploadFiles?userToken="+token,
					type:"post",
					data:formdata,
					dataType:"json",
					async:false,
					cache:false,
					contentType:false,
					processData:false,
					success:function(data) {
						//alert(data.msg);
						//console.log(data.data.path);
						//$(".hiddenTxt").val(data.data.path);
						callback(data);
					},
					error:function(data) {
						layer.msg(data.msg);
					}
				})
			}
			//- 点击删除图片
			$(".hz_photo").on("click",".imgwarp i",function() {
				$(this).closest(".imgwarp").remove();
				$("#horderImg").show();
				$(".hadd-img").show();
			})
			
		})


